//
//  MyFunctionDemoTests.m
//  MyFunctionDemoTests
//
//  Created by Ting Han on 2017/8/28.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "DefaultNotificationCenter.h"
#import "IndexPathRange.h"

@interface MyFunctionDemoTests : XCTestCase <DefaultNotificationCenterDelegate>

@end

@implementation MyFunctionDemoTests

- (void)defaultNotificationCenter:(DefaultNotificationCenter *)notification name:(NSString *)name object:(id)object{
     NSLog(@"接收到通知");
    if ([name isEqualToString:@"hhhhhh"]) {
        NSLog(@"接收到通知");
    }
}

- (void)setUp {
    [super setUp];
   DefaultNotificationCenter *center = [DefaultNotificationCenter defaultNotificationCenterWithDelegate:self addNotificationNames:^(NSMutableArray<NSString *> *names) {
        [names addObject:@"hhhhhh"];
    }];
   
}

- (void)testNotificationCenter{
    
    [DefaultNotificationCenter postEventToNotificationName:@"hhhhhh" object:nil];
}
- (void)testIndexPathRange{
    
    NSMutableArray *ar = MakeIndexPathRanges(@[ MakeIndexPathRange(1, 2, 4), MakeIndexPathRange(0, 8, 4)]);
    XCTAssertTrue(ar.count == 8,@"对吗");

}


- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
